package be.sc.classicnetwork.service;

import java.util.Collection;

import be.sc.classicnetwork.dao.CarDao;
import be.sc.classicnetwork.dao.PaginationSearchResult;
import be.sc.classicnetwork.model.Car;
import be.sc.classicnetwork.model.Contact;
import be.sc.classicnetwork.model.Image;
import be.sc.classicnetwork.model.code.Make;
import be.sc.classicnetwork.model.code.Option;

/**
 * Car Service.
 */
public interface CarService extends GenericService<Car> {

    /**
     * saveOrUpdate.
     */
    Car saveOrUpdate(Car car, Image[] images2delete, Collection<Option> options);

    /**
     * countMakes. [0] make name; [1] count make; [2] make id.
     */
    Collection<Object[]> countMakes(boolean enableFilterPublished);

    /**
     * findAll.
     */
    PaginationSearchResult findAll(int first, int max, boolean enableFilterPublished);

    /**
     * @see CarDao#findByMake(int, int, boolean, Make)
     */
    PaginationSearchResult findByMake(int first, int last, boolean enableFilterPublished, Make make);

    /**
     * Finds the cars having a make or model like the specified value.
     */
    PaginationSearchResult findByModelOrMakeLike(int offset, int maxPageItems, boolean enableFilterPublished,
	    String model);

    /**
     * findImageById.
     */
    Image findImageById(String id);

    /**
     * findContactsForNotification.
     */
    Collection<Contact> findContactsForNotification(String carId);

    /**
     * cleanCache.
     */
    void refreshAllCache();

}
